//===================================================================================
// $$
//
// Coder: Code Milker v1.0
// 0 - upper
// 1 - lower
//===================================================================================


namespace App.Domain.Handlers {
    using System;
    using App.Data;
    using App.Domain.Contracts;

    public class DeleteCertification {
        private readonly ICertificationRepository _CertificationRepository;

        public DeleteCertification(ICertificationRepository CertificationRepository) {
            _CertificationRepository = CertificationRepository;
        }

        public virtual void Execute(Guid certificationId) {
            var CertificationToDelete = _CertificationRepository.GetCertification(certificationId);

            if (CertificationToDelete != null) {
                _CertificationRepository.Delete(certificationId);
            }
            else {
                throw new BusinessServicesException("UnableToDeleteVehicleExceptionMessage");
            }
        }
    }
}
